package org.simple.jdbc.statement.enumeration;

/**
 * @author jinchengzhen
 */

public enum Option {
    // option for sql
    EQUAL(){
        @Override
        public String toSQL(String... params) {
            if(params.length == 1) {
                return params[0]+" = ?";
            }else {
                return "";
            }
        }
    },
    LESSTHAN(){
        @Override
        public String toSQL(String... params) {
            if(params.length == 1) {
                return params[0]+" < ?";
            }else {
                return "";
            }
        }
    }
    ,MORETHAN(){
        @Override
        public String toSQL(String... params) {
            if(params.length == 1) {
                return params[0]+" > ?";
            }else {
                return "";
            }
        }
    },LESSANDEQUAL(){
        @Override
        public String toSQL(String... params) {
            if(params.length == 1) {
                return params[0]+" <= ?";
            }else {
                return "";
            }
        }
    },MOREANDEQUAL(){
        @Override
        public String toSQL(String... params) {
            if(params.length == 1) {
                return params[0]+" >= ?";
            }else {
                return "";
            }
        }
    },NOTEQUAL(){
        @Override
        public String toSQL(String... params) {
            if(params.length == 1) {
                return params[0]+" != ?";
            }else {
                return "";
            }
        }
    };
    public abstract String toSQL(String... params);
}
